home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / patches / symantec / rtlinc.exe / SIGNAL.H < prev    next >
C/C++ Source or Header  |  1993-05-19  |  3KB  |  123 lines

  1. /*_ signal.h   Mon Dec 25 1989     Modified by: Walter Bright */
  2.  
  3. #ifndef __SIGNAL_H
  4. #define __SIGNAL_H    1
  5.  
  6. #if __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #ifdef __STDC__
  11. #define __CDECL
  12. #define __STDCALL
  13. #else
  14. #define __CDECL __cdecl
  15. #define __STDCALL __stdcall
  16. #endif
  17.  
  18. #if __OS2__ && __INTSIZE == 4
  19. #define __CLIB    __STDCALL
  20. #else
  21. #define __CLIB    __CDECL
  22. #endif
  23.              
  24. typedef volatile int sig_atomic_t;
  25.  
  26. void (__CLIB *signal(int,void (__CLIB *)(int)))(int);
  27.  
  28. #if M_UNIX || M_XENIX
  29. #define SIGHUP     1
  30. #define SIGINT     2
  31. #define SIGQUIT     3
  32. #define SIGILL     4
  33. #define SIGTRAP     5
  34. #define SIGIOT     6
  35. #define SIGABRT     6
  36. #define SIGEMT     7
  37. #define SIGFPE     8
  38. #define SIGKILL     9
  39. #define SIGBUS     10
  40. #define SIGSEGV     11
  41. #define SIGSYS     12
  42. #define SIGPIPE     13
  43. #define SIGALRM     14
  44. #define SIGTERM     15
  45. #define SIGUSR1     16
  46. #define SIGUSR2     17
  47. #define SIGCLD     18
  48. #define SIGPWR     19
  49. #define SIGWINCH 20
  50.  
  51. #if M_XOUT
  52. #define SIGPOLL 20
  53. #else
  54. #define SIGPOLL 22
  55. #endif
  56.  
  57. #define SIGCHLD SIGCLD    /* compatibility   */
  58.  
  59. #if M_UNIX
  60. #define SIGSTOP 23
  61. #define SIGTSTP 24
  62. #define SIGCONT 25
  63. #define SIGTTIN 26
  64. #define SIGTTOU 27
  65.  
  66. #define SIGALL (~(sigset_t)0L) /* All signals.      */
  67. #endif /* M_UNIX */
  68.  
  69. typedef long    sigset_t;
  70.  
  71. #define sigbit(n)    (1L << ((n) - 1))
  72. #define sigemptyset(s)    *(s) = ~SIGALL
  73. #define sigfillset(s)    *(s) = SIGALL
  74. #define sigaddset(s,n)    *(s) |= sigbit(n)
  75. #define sigdelset(s,n)    *(s) &= ~sigbit(n)
  76. #define sigismember(set,n) ((*(set) & sigbit(n)) == sigbit(n))
  77.  
  78. /*
  79.  * Signal vector "template" used in sigaction call.
  80.  */
  81. struct    sigaction {
  82.     void    (*sa_handler)();    /* signal handler        */
  83.     sigset_t sa_mask;        /* signal mask to apply        */
  84.     int    sa_flags;        /* see signal options below    */
  85. };
  86. #define SA_NOCLDSTOP    1        /* ignore SIGCHLD        */
  87.  
  88. #define SIG_ERR     (void(*)(int))-1
  89. #define SIG_DFL     (void(*)(int))0
  90. #define SIG_IGN     (void(*)(int))1
  91. #define SIG_HOLD (void(*)(int))2
  92.  
  93. extern int __CLIB kill(int,int), __CLIB getpid(void);
  94. extern int __CLIB pause(void);
  95. extern unsigned int __CLIB alarm(unsigned int seconds);
  96. #define raise(s) kill(getpid(),s)
  97.  
  98. #else /* M_UNIX || M_XENIX */
  99.  
  100. #define SIGABRT 22        /* abort            */
  101. #define SIGFPE    8        /* floating point error        */
  102. #define SIGILL    4        /* illegal instruction        */
  103. #define SIGINT    2        /* interrupt            */
  104. #define SIGSEGV 11        /* segment violation        */
  105. #define SIGTERM 15        /* terminate            */
  106. #define SIGBREAK 6        /* ctrl-break            */
  107.  
  108. int __CLIB raise(int);
  109.  
  110. #define SIG_DFL        (void (__CLIB *)(int)) 0
  111. #define SIG_ERR        (void (__CLIB *)(int)) 1
  112. #define SIG_IGN        (void (__CLIB *)(int)) 2
  113.  
  114. #endif
  115.  
  116. #if __cplusplus
  117. }
  118. #endif
  119.  
  120. #endif /* __SIGNAL_H */
  121.  
  122.  
  123.